<script type="text/javascript">
    function checkFile(_file) {
        var name = $("input[name='activitifile']",_file).val();
        if(!name){
            alertMsg.info("<@label key='CheckFile_null_msg.D'>请选择文件后再上传!</@label>");
            return false;
        }
        var extend = name.substring(name.lastIndexOf(".") + 1);    
        if(!(extend=="zip" || extend == "bar")){
            alertMsg.info("<@label key='CheckFile_type_msg.D'>请上传后缀名为zip或bar的文件!</@label>");
            return false;
        }
        return iframeCallback(_file);
    }
</script>
<div class="pageContent" layoutH="0" id="import_pagecontent">
    <div class="panel collapse">
        <h1>发布流程</h1>
        <div>
            <form method="post" action="${rc.getContextPath()}/manage/engine/deploy" enctype="multipart/form-data" class="pageForm required-validate" target = "callbackframe" onsubmit="return checkFile(this);">
                <div class="pageFormContent">
                    <input name="navTabId" value="<#if navTabId??>${navTabId}</#if>" type="hidden" id="import_paper_navTabId" />
                    <fieldset>
                    <dl class="nowrap">
                        <dt>&nbsp;</dt>
                        <dd><input name="activitifile" type="file" id="import_fileupload" accept=".zip,.bar"/></dd>
                    </dl>
                    <dl class="nowrap">
                        <dt>&nbsp;</dt>
                        <dd><input name="ismodel" type="checkbox" value="1"/><@label key='create_processModel.C'>生成流程模型</@label></dd>
                    </dl>
                    <dl>
                        <dt>&nbsp;</dt><dd><div class="buttonActive"><div class="buttonContent"><button type="submit"><@label key='upload.B'>上传</@label></button></div></div></dd>
                    </dl>
                </div>
            </form>
        </div>
        <div><h2><@label key='CheckFile_type_msg.D'>请上传后缀名为zip或bar的文件!</@label></h2></div>
    </div>

    <iframe id='callbackframe' name='callbackframe' src='about:blank'"  style="display:none"></iframe>